@extends('front.public_layout.layout')


@section('style')
    <link rel="stylesheet" href="{{asset('/front/css/shop.css')}}">
    <link rel="stylesheet" href="{{asset('/front/css/bootstrap4.3.1.min.css')}}">
    <link rel="stylesheet" href="{{asset('/front/css/swiper.min.css')}}">
    <link rel="stylesheet" href="{{asset('/front/css/animate.min.css')}}">
    <style>

    </style>
@endsection

@section('content')

    <div class="middle-content details-content-box">
        <div class="goods-info">
            <div class="goods-img">
                <div class="swiper-container" id="gallery">
                    <div class="swiper-wrapper">
                        @foreach($goods->slider_img_url as $imgKey => $imgVal)
                            <div class="swiper-slide">
                                <img src="{{ $imgVal }}">
                            </div>
                        @endforeach
                    </div>
                </div>

                <div class="swiper-container" id="thumbs">
                    <div class="swiper-wrapper">
                        @foreach($goods->slider_img_url as $imgsKey => $imgsVal)
                            <div class="swiper-slide">
                                <img src="{{ $imgsVal }}">
                            </div>
                        @endforeach
                    </div>
                </div>
            </div>

            <div class="goods-data">
                <div class="goods-name">{{ $goods->goods_name }}</div>

                <div class="p-info">
                    <div class="succ-num">{{ $goods->sales_num }}<br><span>交易成功</span></div>
                    <div class="p-old">原价<span>{{ $goods->goods_price }}元</span></div>
                    <div class="p-new">活动价<span>{{ $goods->acticity_price }}元</span></div>
                    <div class="boss-check">
                        <img src="{{url('/front/img/icon/icon-check.png')}}">货源所属商家已经过主体资质核查
                    </div>
                </div>

                <div class="g-buy">
{{--                    <div class="send-address">发货地址<span>山西省晋中市太谷区北洸乡</span></div>--}}
{{--                    <div class="buy-num">数量--}}
{{--                        <div class="num-info">--}}
{{--                            <a>-</a>--}}
{{--                            <input type="number" value="1">--}}
{{--                            <a>+</a>--}}
{{--                        </div>--}}
{{--                    </div>--}}

                    @if ($goods->seller_info)
                    <div class="user">
                        <div class="user-img">
                            <img src="{{ $goods->seller_info->head_portrait_url }}">
                        </div>
                        {{ $goods->seller_info->seller_name }}
                    </div>

                    <div class="g-b-btn clear">
                        <a class="show-phone" onclick="show_phone()">查看电话</a>
                        <a class="ask-line" onclick="show_phone()">微信咨询</a>
                    </div>
                    @endif
                </div>
            </div>

            <div class="clear"></div>
        </div>

        <div class="goods-other hide">
            <div class="c-title">其他推荐</div>

            <div class="con-sc">
                <div class="sc-goods">
{{--                    @foreach($otherGoodsList as $otherGoodsListKey => $otherGoodsListVal)--}}
{{--                        @if($otherGoodsListKey < 5)--}}
{{--                            <div class="sc-goods-tmp">--}}
{{--                                <a href="{{url('goods_detial/'.$otherGoodsListVal->id) }}">--}}
{{--                                    <img src="{{$otherGoodsListVal->goods_main_image}}">--}}
{{--                                    <span>{{ $otherGoodsListVal->name }}</span>--}}
{{--                                </a>--}}
{{--                                <div class="sc-goods-info">{{ $otherGoodsListVal->t_price }}元/天--}}
{{--                                    <a href="{{url('goods_detial/'.$otherGoodsListVal->id) }}">联系</a>--}}
{{--                                </div>--}}
{{--                            </div>--}}
{{--                        @endif--}}

{{--                    @endforeach--}}



                </div>
            </div>
        </div>

        @if ($hot_goods)
        <div class="hot-goods">
            <div class="c-title">商品热销</div>

            <div class="con-sc">
                <div class="sc-goods">

                    @foreach($hot_goods as $hotGoodsListKey => $hotGoodsListVal)
                        <div class="sc-goods-tmp">
                            <a href="{{url('shop/details/'.$hotGoodsListVal->id) }}">
                                <img src="{{$hotGoodsListVal->goods_img_url}}">
                                <span>{{ $hotGoodsListVal->goods_name }}</span>
                            </a>
                            <div class="sc-goods-info">{{ $hotGoodsListVal->acticity_price }}元
                                <a href="{{url('shop/details/'.$hotGoodsListVal->id) }}">联系</a>
                            </div>
                        </div>
                    @endforeach



                </div>
            </div>
        </div>
        @endif

        <div class="goods-detials">
            <div class="g-d-head">
                <div class="g-d-title">商品描述</div>
{{--                <a href="#call_us">联系我们</a>--}}
            </div>

            @if ($goods->goods_label_data)
            <div class="g-d-info">
                @foreach($goods->goods_label_data as $goodsMsKey => $goodsMsVal)

                    <div class="g-d-info-tmp">
                        <div>{{ $goodsMsVal['key'] }}</div><div>{{ $goodsMsVal['value'] }}</div>
                    </div>
                @endforeach
            </div>
            @endif


            <div class="g-d-intro">
                <div class="c-title">内容介绍</div>
                <div class="g-d-intro-info">
                    {!! $goods->goods_descriptions->goods_description !!}
                </div>
            </div>
        </div>

    </div>


@endsection


@section('js')

    <script src="{{asset('front/js/bootstrap4.3.1.min.js')}}"></script>
    <script src="{{asset('front/js/swiper.animate.min.js')}}"></script>
    <script src="{{asset('front/js/swiper.min.js')}}"></script>
    <script>
        var thumbsSwiper = new Swiper('#thumbs',{
            slidesPerView: 5,
            watchSlidesVisibility: true,//防止不可点击
        });
        var gallerySwiper = new Swiper('#gallery',{
            spaceBetween: 320,
            thumbs: {
                swiper: thumbsSwiper,
            }
        })

        function show_phone() {
            swal ('下载APP查看', '点击屏幕右上角“手机版”下载APP查看详情');
        }

    </script>
@endsection